package com.weipai.springboot.module.dao;

import com.weipai.springboot.model.Customer;
import com.weipai.springboot.model.CustomerIntegral;
import com.weipai.springboot.model.CustomerReputation;
import com.weipai.springboot.model.EmployeeIncome;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface CustomerDao {
    Customer getCustomerByLoginName(String loginName);

    //验证手机号是否注册
    int getCustomerByMobile(String mobile);

    //保存
    int insert(Customer customer);

    //重置密码
    int updateByPrimaryKey22(String mobile, String s);

    //分页查询
    List<Customer> selectAllByDel(int del, String search, String sort, String way);

    //查询用户详情
    Customer getCustomerById(String id);

    //修改用户资料
    int updateByPrimaryKey(Customer customer);

    //删除
    int updateDel(String id);

    //批量删除
    int batchDeleteById(String[] id);

    //验证昵称是否使用
    int verifyCustomerByNickname(String nickname);

    //修改昵称
    int updateNicknameById(String customerId, String nickname);

    //更改会员的等级
    int changeCustomerMemberLevel(String customerId, String memberLevelId, String remark);

    //更改会员的类别
    int changeCustomerCategory(String customerId, String categoryId);

    //更改用户信誉值的余额
    int updateCustomerReputation(String customerId, int reputation);

    //保存积分记录
    int saveCustomerIntegral(CustomerIntegral customerIntegral);

    //用户总数量
    int getCustomerAmount();

    int resetPhone(String customerLoginName, String customerId, String password);

    //我的收益
    List<Map<String, Object>> getMyIncomes(String customerId);

    //我的团队
    List<Customer> getMyTeams(String adminCode);

    //保存员工的收益记录
    int saveEmployeeIncome(EmployeeIncome employeeIncome);

    List<Map<String, Object>> list(Integer start, Integer size, String type, String search);

    Integer listByPageAmount(String type, String search);

    int updateCustomerCategoryId(String customerId, String customerCategoryId);

    //员工收益的分页查询
    List<Map<String, Object>> getMyIncomesList(String customerId, Integer start, Integer size, String startTime, String endTime);

    //员工收益的总个数
    Integer getMyIncomeAmount(String customerId, String startTime, String endTime);

    //某段时期员工的收益
    Integer getEmployeeInComeMoney(String customerId, String startTime, String endTime);

    //更改用户的状态
    int changeStatus(String id, Integer status);

    //查询某一员工的推荐用户
    List<Map<String, Object>> listByAdminCode(Integer start, Integer size, String adminCode, String search);

    //查询某一员工推荐用户的数量
    Integer listByAdminCodeAmount(String adminCode, String search);

    //修改用户资料
    int updateByHaveCashMoney(int hcashMoney,String customerId);
}
